/*
 * Copyright (c) 2012 Sqpoll.
 * All rights reserved.
 */
package com.sqpoll.survey.service;

import java.util.List;

import com.sqpoll.survey.dao.SurveyMapper;
import com.sqpoll.survey.model.Question;
import com.sqpoll.survey.model.Survey;

/**
 * An interface for survey service.
 * 
 * @author Younggue Bae
 */
public interface SurveyService {

	/**
	 * Sets the SurveyMapper.
	 * 
	 * @param surveyMapper
	 */
	public void setSurveyMapper(SurveyMapper surveyMapper);

	/**
	 * Gets the survey.
	 * 
	 * @param surveyId
	 *          the survey id
	 * @return Survey the survey
	 */
	public Survey getSurvey(int surveyId);

	/**
	 * Gets the survey list by the specified condition.
	 * 
	 * @param parameters
	 *          the parameters
	 * @return List<Survey> the survey list
	 */
	public List<Survey> getSurveys(Survey parameters);

	/**
	 * Adds a survey.
	 * 
	 * @param survey
	 *          the survey to add
	 * @return int the added survey id
	 */
	public int addSurvey(Survey survey);

	/**
	 * Sets the survey.
	 * 
	 * @param survey
	 *          the survey to update
	 */
	public void setSurvey(Survey survey);

	/**
	 * Trashes the survey.
	 * 
	 * @param surveyId
	 *          the survey id to delete
	 * @param uerId
	 *          the user id who deletes
	 */
	public void trashSurvey(int surveyId, String userId);

	/**
	 * Deletes the survey permanently.
	 * 
	 * @param surveyId
	 *          the survey id to delete
	 */
	public void deleteSurvey(int surveyId);

	/**
	 * Gets a question.
	 * 
	 * @param surveyId
	 *          the survey id
	 * @param questionId
	 *          the question id
	 * @return Question the question
	 */
	public Question getQuestion(int surveyId, int questionId);

	/**
	 * Gets the question list.
	 * 
	 * @param surveyId
	 *          the survey id
	 * @return List<Question> the question list of survey
	 */
	public List<Question> getQuestions(int surveyId);

	/**
	 * Adds a question.
	 * 
	 * @param question
	 *          the question
	 * @return int the added question id
	 */
	public int addQuestion(Question question);

	/**
	 * Sets the question.
	 * 
	 * @param question
	 *          the question
	 */
	public void setQuestion(Question question);

	/**
	 * Deletes the question.
	 * 
	 * @param surveyId
	 *          the survey id
	 * @param questionId
	 *          the question id
	 */
	public void deleteQuestion(int surveyId, int questionId);
}
